BEGIN{
	vocab["DEFUN"] = 1;
	vocab[":="] = 2;
	vocab["TEST"] = 3;
	vocab["abs"] = 4;
	vocab["RELOP"] = 5;
	vocab["arctan"] = 6;
	vocab["argc"] = 7;
	vocab["argv"] = 8;
	vocab["case"] = 9;
	vocab["chr"] = 10;
	vocab["cos"] = 11;
	vocab["div"] = 12;
	vocab["downto"] = 13;
	vocab["else"] = 14;
	vocab["eof"] = 15;
	vocab["eoln"] = 16;
	vocab["exp"] = 17;
	vocab["for"] = 18;
	vocab["function"] = 19;
	vocab["goto"] = 20;
	vocab["if"] = 21;
	vocab["in"] = 22;
	vocab["ln"] = 23;
	vocab["mod"] = 24;
	vocab["odd"] = 25;
	vocab["ord"] = 26;
	vocab["pred"] = 27;
	vocab["procedure"] = 28;
	vocab["program"] = 29;
	vocab["read"] = 30;
	vocab["readln"] = 31;
	vocab["repeat"] = 32;
	vocab["reset"] = 33;
	vocab["rewrite"] = 34;
	vocab["round"] = 35;
	vocab["sin"] = 36;
	vocab["sqr"] = 37;
	vocab["sqrt"] = 38;
	vocab["succ"] = 39;
	vocab["then"] = 40;
	vocab["to"] = 41;
	vocab["trunc"] = 42;
	vocab["until"] = 43;
	vocab["while"] = 44;
	vocab["with"] = 45;
	vocab["write"] = 46;
	vocab["writeln"] = 47;
	funfound = wasdefn = 0;
}
{
	if (funfound == 1)
	    {
	    if ($1 != ":=")
		if(version == 2)
		    printf("PROC\n");
		else
		    printf("48\n");
	    funfound = 0;
	    }
	if (length(vocab[$1]) > 0) 
	    {
	    if(version == 2)
                printf("%s\n", $1);
            else
                printf("%d\n", vocab[$1]);
	    if ( $1 ~ /DEFUN/ )
		wasdefn = 1;
	    }
	else if ( $1 ~ /_FUN[0-9][0-9]*_/ )
	    {
	    if (wasdefn == 0)
		funfound = 1;
	    wasdefn = 0;
	    }
	    
}
